added tests and fixed image bug