If you have the thumbnail and image, it's just simple HTML.
<a href="image.jpg"><img src="thumbnail.jpg" alt="Image description"></a>
If you need to automagically generate the thumbnail, you might be looking at a third party thing (and are past my expertise.)
Thanks Puckdropper,
I want to generate thumbnails from image files, so that clicking on thumbnail will load file in its full size. I don't have thumbnail image of the file. Does PHP have tools to manage image size ?