Fix possible out of bounds errors in AddToImage()
When a facet gets aligned, its width and height may extend beyond the edge of the full image. AddToImage() should in that case not write to those values.
When a facet gets aligned, its width and height may extend beyond the edge of the full image. AddToImage() should in that case not write to those values.