fix query edit bug on image gallery