Welcome to the HUGO community.
As a static site generator - the html, css, js, images etc. that Hugo generates usually ends up hosted and readily available with no form of authentication required (the awesome team @Netlify do offer some solutions for this with their premium plans)).
This means that if you put up a directory full of images, a visitor to your site would be able to look in your source code, identify the path to your images and get easy access to them all if they so choose. e.g. here you can see an image directory on the gohugo.io site:
If you don’t mind someone getting access to the images if they wish to, then you can do what you would like to pretty easily.
You can create a map to the images using HUGO’s Data Templates to provide the links to the images and then you could attempt some “security through obscurity” to try and hide the image locations…but not very well if someone wants to get at them and knows how to view page source.
In summary here, you can do what you want but the protection of your pictures is weak and tending towards zero.
However…if you want to make things somewhat harder, you could get a little more technical.
You could encrypt the images using the unique code you plan to give out as the unique encryption passcode for each image - all clientside.
You could then change your form to be a two field form. 1 field would take a unique identifier that can be mapped (as described previously) to the encrypted image files or (base64 encoded data). the 2nd field would take the symmetric passcode used to encrypt the image which would be used this time to decrypt it.
Submitting the form would return the decrypted image to the visitor.
The length of the passcode would need to be a decent length of random bits in order to actually give any hugely worthwhile protection, but, I would think that 8 bytes or so would hold an attacker back for at least a few minutes which is probably enough for your use case.
Have a look at crypto-js and/or Forge for the practicalities of the encryption.
If anyone is interested in this concept more generally, drop me a line.