Corrected an issue where a resampled image would return the original image reference.