more correct handling of flipping photos