Fix JS error when adding new media
Formatting
Fix adding media to cart in insert media dialog
Address code review comments
Attached event handlers for the OptionWidget objects are already removed by oojs-ui
VE-1296: Minor code reformatting
Merge pull request #4025 from Wikia/VE-1296

Fix JS error when adding new media