fix gallery shorcode query issue