Save the displayed animation frame in a key of the local storage.
On start of layout, set the animation frame displayed to be equal to the value stored in the local storage key.
The first time you execute your game, the key does not exist, so the default value will be 0.
Be sure to then create a key using the default value.
This mechanic is explained in my Asteroid in less than 100 events tutorial, dealing with the scores.