Made changes to Resize function, no more infinite while loop. But this
time, the images still don't match.