Added option to read images in gray level