fixed upload image bug with js and template