If you have a max image width and height that you allow, and scale/crop larger images to fit, then you could do something like this
<!-- these are the "form elements", except no form is needed, since nothing is sent from here -->
<input ... />
<input ... />
<input type="button" onclick="popup_and_submit();" />
The code executed on button click will create a popup with dimensions matching the largest allowable image, create a form element add all necessary form elements to this form, using the values supplied from the page above. The popup then submits data to your php image annotator script, which returns html containing an image element for the new image file.
But if you do not have a max image width and height, you will not know how large an image is needed, or if you prefer to always create a popup being as small as possible to fit the image, then have the php annotator image script also output the same form as the user initially filled out, but this time repopuplate the form controls with the previously filled in values (except for file selection which you can't set)