Added an option to write every frame to a png file.