In powergallery the lighbox effect is applied on the page that displays the image after it is uploaded, just like Dani suggests. They are just all combined into a multiple page solution so it works seamlessly.
The difference I think is that you were using HTML editor to upload and specify the images. PowerGallery uses a custom upload script and stores the images into their own image database. It allows us to fully customize each image and script where it is displayed unlike the html editor which places each image in context.