learningequality/ka-lite — pull request #1873 by bcipolli (2014-04-03 19:35:56+00:00)
Title: Fix for #1636: select thumbnail format from a list instead of hard-coding to png.

Issue:

* Videos downloaded via youtube_dl (dubbed and English non-uploaded to Amazon) weren't showing a thumbnail. This makes links to "related videos" problematic.
* We're actually downloading JPG thumbnails, but we had hard-coded the `.png` file extension

Fixes:

* When building lists of video resource URLs, search for whatever thumbnail format is available, and use the first one that is.
* If none are available, show a text-based (rather than image-based) link

Testing:
* I downloaded some videos and tested that the preview image shows on the video download page.
* I also checked that the "related videos" image shows.
* Finally I checked that if no thumbnail is available, the "related videos" link changes to text.

.jpg preview image working:
![screen shot 2014-04-03 at 12 35 08 pm](https://cloud.githubusercontent.com/assets/4072455/2608120/063e676a-bb67-11e3-8b55-1bd1b48f511f.png)

.jpg preview image working from exercise page
![screen shot 2014-04-03 at 12 31 33 pm](https://cloud.githubusercontent.com/assets/4072455/2608121/063e9136-bb67-11e3-85ac-9a9a7e75f3af.png)

missing preview image on exercise page
![screen shot 2014-04-03 at 12 35 23 pm](https://cloud.githubusercontent.com/assets/4072455/2608122/064254d8-bb67-11e3-90ad-f4326e6dfa8a.png)