added delete option for uploaded files - refine javascript code