fix gallery problem presented by WP 3.8.1