generic JS usable when a row is duplicated when file is a part of a ManyToMany

How to reproduce :

Use a FilerField in a ManyToMany, and use admin's inline to manage it in the admin form.
When "add new row" is clicked, the "clear" image is displayed and not functionnal.

This is because the old javascript is for the current ID, so new lines, with != IDs, couldn't work. This bug fix use classes and the jQuery(document).on function to watch event on newly created lines.