My adaptations to folio-gallery from http://www.foliopages.com/php-jquery-ajax-photo-gallery-no-database