Back when I put together my photolog I was looking for a popup script to pop up my images without having to specify width or height or creating a separate html document for each image.
Amy of domesticat.net had just come out with a php/javascript solution (no longer available) and it was interesting, but the popups came up in a default size window and then were resized after the image was loaded. It seemed to rely on javascript too much for me and was a bit buggy.
After searching through a few scripts and not really finding any to suit my needs, I found out about the getimagesize function in PHP and fell in love with it and started using it to figure out the width/height of my popups. After that it, was all pretty simple.
A few days ago, I suggested the meat of the script to Amy and she took the code, improved it and wrote an EXCELLENT tutorial on how to use it. That script is now available HERE [link updated Dec 9] on her site for download!!