added image upload function
ref #4