fixed tests and error in image upload