added some functions (upload_image, write_image, write_emoticon)