fix sql
fix gallery