Optimized the video thumbnail creation
Reorganized the thumbnail code