Added image saving into mongo. TODO: fix image-serving code in main.js