Added fix for wrong thumbnail handling when EXIF orientation is broken.