write images from video