We couldn’t think of a good scenario for why you’d want to do this, but if you want to convert a list of images into a single PDF file, you can do it with a single command. At least, on Linux or Mac. If you’re on Windows, you’ll need to install Cygwin with the Imagemagick package, or use the Windows version of Imagemagick from the command prompt.
Either way, it’s a single command.
convert *.jpg images.pdf
You can change the *.jpg part to *.png or whatever selector for files that you want, and obviously change the name of the PDF output to something else.