Added a check for a single channel image