Some thumbnail generation improvement

Signed-off-by: Ignas Anikevicius (gns_ank) <anikevicius@gmail.com>