Second. I have a question

I'm creating a page where I have to insert in a table "products" and this product have multiple images. [b]This images paths are not stored in DB[/b], just according with the code of the product inserted, a new folder are created, and the pictures go inside.
The porblem is: I can't in the same page in the add action put a button and open a fancybox, and inside do the [b]multiupload [/b]because the new product are not saved yet, so I don't know the ID (pk) to create a folder.
If I take the max(ID) +1, and use it, the user can open the add page, upload photos and NOT SAVE the product. So, when the next user add another product, the photos will be already there. But from the wrong product.
My try was use a callback "callback_after_insert" and from inside tell to open a new Fancybox window to the user add photos from the product just saved. But any JS that I send to output aparently are not executed.
Someone have a idea so work around it?
Thanks in advance.