ImageLibrary problem solved by passing the library via a parameter.