added resize event and modified carousel