Use sinon.js to test the thumbnail fetching

Change-Id: Ida6143e29e54d90f26e7888aced1d207b3bfa702
Merge "Use sinon.js to test the thumbnail fetching"