Fixes a problem when the user closes the upload window without selecting anything

When a user closes the upload window without selecting anything, the next call to an upload window would set the selected image twice, one on the previous upload field, and one on the currently selected upload field.