Well, this is quite easy to fix as you like, thats why there are options in the thumbs window.
You can create thumbnails exactly as you like. When you went to "thumbs", you must have seen some size settings for the thumbnails? Read more here:
https://www.photo.gallery/documentation/create-thumbnails/
You should be setting your thumbnails to "resizetobox" to keep them same aspect as your originals. However, if you do this, you will of course get BORDERS because you have a mix of aspects in this folder. How else would the gallery display your different-aspect thumbnails without creating borders(margins)? Only if you create them with "croptobox" will all thumbnails be identical, and you are sure to not have extended margins or borders ...
There is actually a small bug going on, which is fixed in the latest release. You can fix this though (without having to upgrade), by uploading a "dud" image, and then delete it ... Then margins will update and fix the layout.
In the end of the day, you have FULL control of the size- and style of your thumbnails, and the layout ...