moved duplicate upload validation code into its own fn