Clean up single media upload, fix some bugs