Do we really care about accumulating the correct flux and centroid from the padded region?  It would be a lot more efficient to just copy the entire pad_image and then overwrite the portion where the original image goes.  

This occurred to me because I was thinking of changing calculateStepK to only accumulate the flux within the original image region rather than going through the fully padded image.  It would speed up that function quite a lot.  (Factor of 16 typically.)