Try to transform/rotate the visibleRect when rotating the image