VID-2139

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

@lizlux done: 9da156d