fix drawing of grayscale images in ui