Note that you never actually use imageProcessCTX anywhere, so I think you don't need to set it.   Storing it on self just leads to potential memory leaks.

I actually think you don't need the ctx object at all, since the restore callback and the processNextTile function are all inside this containing function. Does it still work if you get rid of all the "ctx." prefixes?  If so, that would make the patch much, much cleaner.