update layout, add gallery and popup