Fix a bug with image stitching, which caused the images to be stitched
twice, lowering the overall performance...

Add some javadocs.