fixed bug when you flip the image