Fix JS error when adding new media

@mklucsarits I see here potential for memory leak - event handler is attached but it is never disattached even when the item is gone from the grid (when user performs different search).