Fix IndexError when EXIF data is broken

See http://blog.yawd.eu/2012/fix-sorlthumbnail-engines-pil-orientation-error/