Gallery Widget: Support previous versions of WordPress

In a681bb2, we added support for WordPress 3.9 but apparently broke support
for previous versions. This commit should restore support for WP < 3.9.

Fixes #437.
Merge pull request #442 from Automattic/gallery-fix

Gallery Widget: Support previous versions of WordPress