Fix bug that cannot rotate image counterclockwise