fixed greyscale decoding