Started implementing average colour analysis.. sometimes gives NaN.. why?