the exact details are a bit complicated, and require tight co-operation between server and client, but here is a rough sketch for you.
from the popup, the main window is called opener, and from the main page, the popup is given a variable.
the variable's value is set to the popup's window object by using the window.open command which creates the popup and returns the child window object.
an onsubmit event in the popup's upload form can say something like:
where monitorDL is a function which can re-ajax every 3 seconds until the server returns the HTML to show the image.
you might need to pass additional urls ids, etc to steer the requests.
like i said, it's quite complicated for something seemingly so simple, and lots of commercial solutions are out there.
Let me know if you need more info about any particular step.