#2030 - Fix thumb hover effect for 3.0.6.

This is adapted from the commits on the 3.1.x branch:
09fbe4c3442af2689b1ec7e540cd87a282c01123 & ef2ca6edb572501145ec3a4d6aa529118081188a.
The changes to ui.init.js are the same; the changes to gallery.common.js are
slightly different for better compatibility with jQuery 1.3.