refactor lightbox helper only function in view