Clean up files when uploading plus more uploading logic