Change the procedure of rotating image