Steps for adding a photo or video to the Media Gallery.
1) Check File Name Availability - Adding a file with the same name as an existing file in the corresponding community files repository is not allowed
2) Retrieving nonce and user information - Adding a photo or video requires providing a valid nonce for security purposes and a user id.
3) Upload Photo or Video
4) (Optional - Video Only) - Add a thumbnail preview image file to be associated with a video uploaded.