unit tests for ExternalImageController and made class unit testable