Thank you for your post, and I apologize for the late reply.
With FileMaker Pro, you can import a folder of images into a table. In a separate import step, you can import data from a text file. Once the information is in the table, you can write a script that loops through the file saving each picture as a JPG with the Student Number. A sample script could be:
Go to Record/Request/Page [ First ]
Set Variable [ $path ; "file: " & <student_number field> & ".jpg" ]
Export Field Contents [ <container field> ; $path ]
Go to Record/Request/Page [ Next ; Exit after last ]
That is, go to the first record and enter the loop. Set the variable $path to include the student_number field, and then export the Container field to $path. Go to the next record and repeat the loop. After you process the last record, the script exits.
You can print each students image with the name below it, but you can only save it as PDF; not JPG. You'll need another graphics tool to put the name with the photo and save as JPG.
Please let me know if you need clarification for any of the above steps.