Fixed image upload for chrome and safari