Changed program to capture frames for animated GIF