Switched to using new code for uploading tweet plus image as August Twitter API change broke upload functionality. Also made some small cosmetic changes to remove some code duplication.