You can create img url based on its id
for video
https://www.youtube.com/watch?v=XXXXXXXXXX
it will be like
https://i2.ytimg.com/vi/XXXXXXXXXX/mqdefault.jpg
https://i2.ytimg.com/vi/XXXXXXXXXX/hqdefault.jpg
first part can be i1, i2 ... you can use i1 (several servers so use any) last part declare img resolution. Better to save images to your own server
the best variant will be http://img.youtube.com/vi/XXXXXXXXXX/maxresdefault.jpg