Changed carousel calculations to allow on-the-fly resizing.