reading images from a directory and converting to black and white