more flexible type for resampling images