Well, we assume you're using a database? And you've written a code generator for your friend?
You need to store the filename(s) of the photos in the database along with other data, including the generated code.
Your display page will select the filename(s) from the database which match that code, and display them. Got something started?