Better upload logic, better duplicate name logic