Made galleryDOM functions more generic.
All relevant data attributes are now correctly added, updated, removed.