fixed the bug in image distortion