Brightness average wasn't calculating correctly