complete image upload method