remove duplicate code

refs #4504 

During anonymous upload implementation some js code has been extracted.
Some code was left behind - this PR is cleaning the mess.

@schiesbn @butonic @blizzz @ringmaster THX