fix stitching problem with image dilate option