If there are no slideshow items and this function is called, it would cause a null pointer dereference.