Line Division implemented with Server Divs

The lines in the uploaded image now correspond to the ones detailed in
the "divs" array returned by upload_image.

Also fixed: Closing the dialog deletes all of the html that used to be
inside it, so another file can be submitted after canceling and it will
display correctly.