Victory !
After a day or two of playing around with scripts and functions, and learning a lot along the way, I've come up with a one line script that removes the filename extensions of the imported pupil photos:
REPLACE("destinationfieldname","SUBSTITUTE(sourcefieldname,".JPG","")")
So "Lyons C.JPG" becomes "Lyons C"