added support for grayscale and rgb images