Add function to handle exif orientation