I changed out the javascript and used this:
<a href="image.php?doc_img_id=<?php echo $row_docs['doc_img_id']; ?>"><img src="docs/thumbnails/_TN<?php echo $row_docs['doc_img_id']; ?>" ></a>
I can see the image name is correct in the status bar when I pass the cursor over it.
I tried your suggestion but that didn't work.
I also created a recordset in DMX and inserted the field doc_img_id into the IMG SRC and it displays, but it displays the image from the first record only. Any suggestions?