combine query result page and gallery page into one table