Add some comments to Rotate Image
Refactor to make the logic uniform