How to take a random jpeg and a random mp3 to create a video file in ffmpeg?

I am working in a batch conversion process where I need to add a random image (a jpg) on ​​a random mp3 and create a mp4

it's the code I use in the terminal mac os x putting all the mp3 and jpg in the same folder

for f in * .mp3; do /usr/local/Cellar/ffmpeg/4.1_1/bin/ffmpeg -r 1 -loop 1 -i abc5.jpg -i "$ f" -c: copy -c: v libx264 -vf scale = 1280: 720 -shortest "$ {f% mp3} mp4"; completed

it works fine but i do not know how to add another random feature for jpg files, so every time i have to put a different jpg and change name (usually in the file, not in the script) i also know that it must be something with for ((… but I do not know how to add it correctly.
thanks for your help this will improve the batch work I have to do.