rotate image is working correctly