Constrain thumbnail downsampling to JPEG types.

Change-Id: I5d94be657015fd6008802d3b1d530a68cdd45abd