This is edge case and fix of javascript error in logs when user opens gallery app and rotates the phone from landscape to portrait in thumbnail list view, there is error in logs
01-23 12:27:41.249 E/GeckoConsole( 9869): [JavaScript Error: "ReferenceError: currentFrame is not defined" {file: "app://gallery.gaiamobile.org/js/gallery.js" line: 1145}]

I tried to use your suggestion but still sees the error,  the other alternative is to see whether globally scoped currentFrame is defined in its enclosing context like 
window.currentFrame  && window.currentFrame.video  
or 
this.currentFrame  && this.currentFrame.video

Let me know if you want me to update the PR with either of the above checks. Thanks