This function will make sure the target directory is writeable, and then save the image.
If the target directory is not writeable, the function will try to correct the permissions (if allowed, this
is set as an option ($this->options['correctPermissions']). If the target cannot be made writeable, then a
RuntimeException is thrown.
TODO: Create additional paramter for color matte when saving images with alpha to non-alpha formats (i.e. PNG => JPG)