The image is now being trimmed before being written to disk.