Resize the image according the ratio of the size of original image.