Changed way to calculate the average from image

Improved performance a bit and works little better