[BUGFIX] Only render hidden upload fields if a resource is available
The UploadViewHelper always creates hidden fields for filename and
resource pointer so that previously uploaded files are not lost
if validation errors occur.
This change makes sure that those hidden fields are only rendered
if a file has been uploaded before because otherwise the property
mapper tries to create a Resource object and fails with an
exception (see #38184).
Releases: 1.1, 1.2