fixing contour integral image bugs