Added getSumOfPixels method