Fixes #1185. Refactor UploadPostTask.uploadMediaFile.

Fixes #1185. Moved the logic of uploading video and image files into
their respective new methods to make it readable.