Issues saving large images in IOS

I think in the direction of async behavior of DOM. You do appendChild() then click and then immediately removeChild(). I'm wondering if the download could fully execute before you call removeChild(). I suggest to test by commenting this last call to see if it helps. If so, try to remove this element only after a certain timeout.