Fixed segfault in ci_toggle_animation, fixes issue #173
Simplified img_frame_animate