I'm not sure if you simply want a grid of images or make a real mosaic where each image will act as a "pixel".
One way to do grids with Photoshop is to use the "Contact Sheet II". You'll find this in the menu File, then Automate, then Contact Sheet II.
This is quite an old functionality in Adobe Photoshop. It's already installed in Photoshop and haven't changed much in the last 10-15 years.
Very useful if you need to quickly create catalogs for stock images as well since you can add the name of the file too below each image, if you want.
There you can specify the folder where all your images all, color mode, size of the image, rows/columns, spacing, etc.
Ideally, your images should all be cropped already to be square. That can be done with an action before using the contact sheet. But the size will be adjusted automatically though and your images can have different sizes.
The contact sheet will take all the images in the folder you selected and stick them next to each others automatically. If you want a particular order, you can name your file accordingly (1.jpg, 2.jpg, 3.jpg, etc.) and select the direction to apply the images.
If you have more images than what can fit on one page, Photoshop will create a new document automatically and will keep going until all the pictures in the folders are used!
I think you cannot use thumbnails smaller than 100px but you can always resize the final result after you're done.
Once the automation is done, you'll have your file with masonry opened in Photoshop and can save it in the format you want.
This is an example of a bunch of thumbnails together using the contact sheet: