I'm a noob, but maybe this will help.
You need an event that tells your program the video has finished playing. Maybe myMovie.available() will return false if there is no more movie to read?
if (myMovie.available()) { myMovie.read(); }
else { takerandomimage(fn); }