performance optimization in javascript
update to carousel dimensions