Technically, one could very easily argue this is illegal as you're reproducing copies of the images without permission. Obviously, this sort of thing is very standard on a lot of the internet, and most people know the risks of putting their photos up online. But there are also copyright trolls out there who love sending companies demand letters over small, accidental infringements.
It's theoretically possible for companies distributing Debian to be sued for contributory infringement in a case like this. Very unlikely, but *possible*. Especially if the program downloads the same images for all users, because then I can know for sure that some huge swath of Debian users have downloaded my photo. The program also creates an easily discoverable directory of evidence, which might make things worse if a lawsuit ever gets going.
Would you be able to write a version that only downloads images with a known license on a certain list of good licenses, or images known to be in the public domain?