fix image rotation and limit images to 800x800