Check if Connection and Configuration are existing in the imageHandler.

Also add a unit test, checking for both cases.
Add unit test for the image handler if image is not found.