Changed the structure of the procedure to create the video thumbnails.