working solution for ajaxified image uploads