Update the ImageManager js object

- No dependence on Mootools
- Support both jQuery and Mootools version of Chosen (whichever is
  installed will just work)
- Remove/consolidate unneeded/repetitious code
- Fix bugs such as uninitialized variables

Tracker: http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=33965&start=0