This was a problem with the EXIF orientation tag.
Fixed it with this:
# Open the image using PIL image = Image.open(local_file) from PIL import ImageOps image = ImageOps.exif_transpose(image)
‘’’