Check if exif were read before using it.
Create a process_image function.
Replace the jpg_quality setting with a dict of options.

Pass a dict with PIL options (quality, optimize, progressive).
Enlarge the MAXBLOCK buffer of ImageFile if there is an error (for the
progressive mode).