Adds functionality to set "selected" class on selected thumbnail