With this Photoshop script you can array and create a matrix of images, you define the amount of files or rows and click "OK" that is it.
Available at: https://bit.ly/39ZH5Qm
We are working to add new functionalities (like margins), any feedback is welcome!
Cheers.
Sergio