Update slider and gallery to work with picture element.

Is there an advantage to using a function here rather than an object?