add convert_imageset_gray to convert gray images. It uses opencv imread with grayscale mode, so it can also handle color image files, but the result is grayscale.