repaired image-upload.
improved tests.
added tests