Fix checking for grayscale