add two stage in ajax for better image uploads like PHP upload