Several commentators (e.g. Vice article) have pointed out that the current Canadian election campaign has featured pretty heavily opposition research. So the context in which these Trudeau photos were released is not accidental, especially since similar material was used against Trudeau's opponents recently.
On the other hand, little has been revealed insofar how the first photo of Trudeau was discovered. A bit more is known about the subsequent ones, the effort for which appears to have been squarely inspired by the first, and they came from varied sources. The 2nd photo was found by Canadaland, a blog which specializes in deep digs in politicians' past. They claim to have simply used the Wayback Machine to look for similar material.
Some more commentary in Vice:
Given that this story broke in TIME rather than a Canadian outlet, you have to wonder whether any media companies here turned the story down and what reasons they gave. You also have to wonder why it didn’t come in the 11 years Trudeau has been MP, the six years he has been leader of the Liberals, his first election campaign as leader four years ago, or his first term as prime minister.
(Though in CANADALAND, Robert Jago has perhaps the best explanation: “Because he was a lifelong celebrity, I’d no sooner look into his background than I would the backgrounds of Prince William or a Kennedy—people about whom all is apparently known.”)
TIME does say how they verified the material's authenticity, but not how they found it out in the first place.