This question already has an answer here:
I have a few hundred image files. This consist of files of multiple type like 1.png 2.jpg 3.png and so on. I want to create a PDF from these images without changing the order of pages. The number in the image name must be used to preserve the order of pages.