updated ui.js for gallery nav