Updated JS to handle grid/list view changes

When toggling between grid and list views on the collection pages, the URL would continue to grow even if a `view` parameter already existed.

Eg. `accessories?view=list&view=grid&view=list&view=grid&view=list&view=grid&view=grid&view=list&view=grid`

The updated JS replaces the `view` parameter if it already exists.