Tiled Gallery margin fixes

This PR fixes two problems with margins in Tiled Galleries, one with the square layout, and another with the mosaic layout.

* When you have a four image square layout, sometimes when the one remainder image that doesn't fit the three images per line would be placed on top, and be a few pixels less wide than the three images below it. [Here](https://cloudup.com/cJvZwqFaINx) you can see an example. Pay close attention to the right side of the Tiled Gallery. This is fixed by properly computing the margin into the remainder space width.

* Tiled Galleries sometimes exhibit exactly twice as large a margin in the mosaic layout's top and bottom gaps between images than is between images as left and right margins, as can be seen [here](https://cloudup.com/cjc1I3NAtC1) in the left image. I think the galleries look neater without the double margin, which has been removed in the PR.