CHANGED:applied the saveRotatedImage function,sort of UIElements modifications