base image upload functionality