update ImageRotation.cs, improving its performance.