fix database of gallery page