In Wikibooks it is suggested that to have subfigures, one should use the subcaption package.
However, in the given example, the caption package is also included. Is it necessary here? If so, what is it for? Usually, including captions (e.g. \caption{Pictures of animals}) does not need the caption package.