Adding duration to thumbnails and fixing code