fix gallery shortcode issue when global=true