Image histogram creation fixed