That should be enough to send the image's filename to your email along with the form. To get the image on the confirmation page I suggest you add the filename to a cookie and then use a second script on the confirmation page to read the cookie and load the script.