Bug 947029 [B2G][Gallery][Small images]Extremely small images display in...

...gallery with a larger than expected thumbnail

Addressing review comments from https://github.com/mozilla-b2g/gaia/pull/16340.

Move 'thumbnail size' logic to new ThumbnailSize object