VID-2139

Few optimizations and code cleanups in Thumbnail code

https://wikia-inc.atlassian.net/browse/VID-2139

Ah, right.