Repair histogram creation. Refactor color counting into MyImage