make the code dal better with input images that are of different depth/number of channels