BAC-239: Create unit and integration tests for ImageServing

+ code cleanup