clean up functionality surrounding image upload