Thanks again! Everything is fixed now! Since I'm planning to use NW.js I just added the nice NWjs.ReadFile function and it all works out!
First page was not working correctly, because I had added array saving to page changes, but not before saving the file - so wherever you would save just being on an untouched page the array would be empty (or represent an older version of that "page").
One small "bug" still left is that if we have an empty page upon adding that page its array is already there, so we get one [0,0] junk entry. But in real life the array would have more data, some of which would never be 0 so I can just check for that. Or I could add a function that only adds an array on the first click, if needed.
Edit: Some strange behavior, but perhaps I just don't understand sequence of events or such. Anyhow, I have a " On open dialog OK" event that triggers the loading of a JSON file into a Dictionary and from there into Arrays. It seems to work, but for some reason when in the same set of actions I call the function to redraw the sprites based on array contents it just does not fire at all.
If you are willing to have a look it's right at the bottom here, under the last comment:
https ://files. fm/u/3zpa9n6k#_ (Still need to remove space, it seems).
Any clue why the function does not work there? It works for all other things we do, like flip pages, delete or add them etc.