Fixed rotation bug when using non-1:1 image