fix offset calculations for pixelRow and pixelCol