fixed histogram, found bug in grayscale