Issue 3714 script error in console for binary thumbanail 2.5

Merge this one only on master-2.5 please, I have a diferent pull request for 2.6