Image rotation handled with exif data in prepare_images.py plus refactoring