added image upload function