Fix a bug when resize same-ratio images.