issue 23

some refactoring and new test for multipage image handlers