added functionality to rebin 3-color (and different data type) images