Also search for png files.
If the file doesn't have an exif section, just skip that.
Remove the erroneous variable reference.
Also do gif files.
When saving image files, don't mandate JPEG. Instead, let PIL determine the format from the filename.
Also search for bmp files.