updating the dynagallery code