Use sizeof(struct slide) instead of on uninitialised pointer
Allocate slides on stack using count_slides func