This commit refactors the ImageBuilder factory to be a real factory and to add type hints such that its use from an api perspective is clear and enforced. Related to Issue #1498