Fix JS error happening when closing "use this file" dialog

Change-Id: I690f473ea17117bed7d30e1a858f6612f57fc33e
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/224
Merge "Fix JS error happening when closing "use this file" dialog"