>>2236398Not sure how technical you want to go but the ImageMagick package might help you out.
see
https://stackoverflow.com/questions/64431814/how-to-fit-multiple-images-in-a-page-optimally-using-imagemagick for an example
I created the attached image using
> magick *.jpg -define ashlar:best-fit=true ashlar:canvas.png[1000x2000+5+5]