To make the thumbs fit the justify script will do some extra sizing (with possible upscaling).
Because it is not good to have the thumbs enlarged, the height of the row is set smaller than the actual image size. A second parameter tells the script the maximum rowheight having the actual height of the images.
The behavour is explained by the author here
The rowheight in the current minigallery version is set to 62.5% and the maximum height to 100% of the thumbnail sizes.
The actual output will be somewhere between those values.
These values are based on some testing I did with sets of images and not calculated in a scientific way.. It could be other scaling parameters might work better
rowHeight : <?php echo $thumbsize / 1.6 ?>,
maxRowHeight : <?php echo $thumbsize ?>,
You could experiment with this (1.6) devider to get a better view.