With the GD library you can create and minipulate images. One of the things you can do is combine two images into one. You could thus loop through your directory with images, and for every image found, adda logo on top. Or you could do this on the fly, specified in a function ina seperate file, and display your images:
<img src=\"overlay.php?someimage.jpg\">
But GD library is quite extensive & complex. So have a read though the general info on it.
http://nl.php.net/manual/en/ref.image.php