First find all the files you want to convert and store their filenames in a file

Iterate through that files and make a jpeg from them

Finally move all jpgs to a separate location if necessary