Typically, there are a few lines at the border of the images where the image slowly is going into the background. For GradientMergeMosaic, the border between image and background must be without any additional pixels. Zoom to 1:1, and have a look at border pixels.
Georg