> Very hard to maintain due to use of YouTube-dl, plus legacy search API
With yt-dlp you can do this:
yt-dlp ytsearch5:IMG_0416
which searches for IMG_0416 and downloads the first 5 of them. There is no need to use YouTube API.