resample images when resizing them