Added event and onopen callback options.

Don't subclass Array for the helper function, as IE<8 doesn't update
the length property (strangely, it does so in IE7 mode of IE10).
Fix issues with cached images and IE7 in the imageFactory.
Trigger Gallery events on the widget container for the jQuery plugin.