Moved all carousel calculations to JS and fixed browser support