I think there is a bug in iOS 8 which prevents animated GIFs from repeating, even if they are supposed to do so.
I have tried setting the source to nothing, then adding the file name back in, but it does not seem to repeat.
document.getElementById("img").src = "";
document.getElementById("img").src = "animated.gif";
Is there a more modern way to reset GIFs than said in this post: Proper way to reset a GIF animation with display:none on Chrome?
Thanks.