Fix photo rotation bug