In.tiff

Change:

    image_data = image.data
    return image_data

To:

    return image.data