further cleaning of js in carousel image resizing