Fixed bug that was breaking image channel after resample.