added db support and html5 lightbox