fix bug pagination in pictures
fix some bug with template