Added functionality to generate grayscale mosaic