API for image upload