ImageMagick convert can convert jpg images to a pdf file.
convert *.jpg document.pdf
It may happen that ImageMagick will refuse to do it with a message like this
convert-im6.q16: attempt to perform an operation not allowed by the security policy `PDF' @ error/constitute.c/IsCoderAuthorized/408.
In that case, use advice from here: https://stackoverflow.com/questions/52998331/imagemagick-security-policy-pdf-blocking-conversion
ImageMagick will make a pdf without bookmarks. You will have to add them with the help of this answers https://stackoverflow.com/questions/30304718/create-bookmarks-into-a-pdf-file-via-command-line.
If you make a script that will sort jpg files (one per page), you will know which jpg is on each page. First, you will have to specifiy each jpeg file
convert a.jpg b.jpg ... z.jpg output.pdf
Then you will set a bookmark a.jpg to the first page, b.jpg to the second, and so on. In that way, you should be able to add bookmarks, too.
I guess you have some scripting/programming to do, but I am positive that it can be done.