fixed rotation of non-square images.
added ability to rotate 180 degrees, instead of rotating twice (a little more efficient).