fix the thumbnail generation for videos, add test