Resample image to the requested size if it is not