jquery function that waits until element exists when building a dynamic carousel.