Well, I didn't make something like that before. Maybe only small collages with 4-9 arts. I have plans to try with YRYR, because I have some cropped manga.
About automatic tool, I used ImageMagick to find pictures with required ratio (for 4:3 it's >1.33 but <1.34) and create big picture using found (resized to 400x300) pictures.
3 commands for 4:3 picture:
# find and create symlinks
find . -maxdepth 1 -exec identify -format '%w %h %i\n' '{}' \; | awk '$1/$2>1.33 && $1/$2<1.34 {print $3}' | while IFS= read -r file; do ln -s "$(realpath "$file")" "/home/ymi/Pictures/collage/4-3"; done
cd 4-3
# montage big picture
find . -maxdepth 1 \( -iname "*.jpg" -o -iname "*.png" \) | montage @- -geometry 400x300+3+3 -tile x collage.jpg


