Yang: 1. code refactor;    2. finish the main processing of upload/download photos.