If your web design studio has a table element, use a locked table (fit to page) and divide and multiply by columns (across) and rows (down). Sort your images by size and usually you can fit image to table cells.
It seems you have about three common image sizes, use three tables that you can add more cells (down) in page editor as you increase your gallery.
If you are inserting code from another program, look for those type of specifics in formatting.