Similar to your original post, I have a database that users can update drawings, then the drawings are sorted in a view.
In the head of the form, i have a CFD field named 'DwgName' with the following code:
dwgname := @DbLookup( "":"" ; "" : "path/file.nsf" ; "view" ; key ; 3) ;
@If( @IsError( dwgname ) ; "" ; @Subset(dwgname ; 1 ) )
where in 'view', column 1 is the document title/key, column 2 is a sorted column to place the newest document with the same key first, and column 3 is 'Attachment Names'.
Later, on the form, where the image will be shown, my code is:
@If( dwgname = "" ; "<h4>(Sorry, No illustration available at this time)</h4>" ; "<img src=\"/path/file.nsf/view/" + key + "/$file/" + dwgname + "\" alt=\"Illustration " + dwgname + "\">")
Which then appears in the HTML page source as:
<img src="/path/file.nsf/view/key/$file/key.jpg" alt="Illustration key.jpg">
See Designer Help -> URL commands for opening attachments, image files, and OLE objects
The solution you found, of course, works as well, and I'm using the same method other places, but for a couple apps, I let the users update the images to be shown on the web then I don't have to mess with it...