Planning - help with ideas!

Hi

I am looking for a small solution for a big problem. I’ll try to explain myself:

I am writing a image upload script. Until here all is good. The only problem is that, when I use the picture, i need to show some legend so people understand what they are watching.

My problem is to add a caption (or multiple) to the image, dynamically, like facebook do to the faces. I’d like to click on the image and add a number in that place then save.

How can I do that? May be with javascript, even with Ajax! I just can’t get how can I place an image over another image dynamically and save its position for future use.

Thanks to all who can help me with tips or solutions.