Brigthness histogram building bug fix.