buid dinamic gallery
refactor old gallery