I replaced the *.zip file in the original post with an updated version of the script, the problem while sending multiple files to the device should now be fixed -- regarding the HTML, this is currently simply too much work for such a small flaw, a simple page forward/backwards entirely fixes it, so I won't look too much into it for now, unless there's huge interest for that (which I doubt). New source code can be found
here.