resamples images