need to flip the image back before saving to jpeg