This is an easy to use dynamic spacing square gallery. If you copy this code, all you need to do is replace the images and make sure they have a 'rel="lightbox[define lightbox here]"' as an attribute to the image (title is optional, but comes up as the description in the lightbox.)
It has a hard set height and width on it, which you can change if you want. Additionally, you can put it in containers larger than 100px, and it will space its self accordingly (ie: 1300px width it'll auto space to 5 columns, centering the bottom row of 2). It will automatically make the image a square.
I manually set up a hover effect for this to make adding images as easy as possible. This uses a different .js file than the default Lightbox, and the downside is you can not use a different thumbnail image than what will appear in the lightbox.
UPDATE: you can have a different thumbnail image, or a compressed version of the image by using the srcset attribute in the image tag (ex. <img src="/wahelper/GetImage?id=275749" srcset="/wahelper/GetImage?id=275749&width=400" rel="lightbox[gallery]" title="Caption" /> )