add title and info button, simplify main gallery code