Add support for different types of images, case in which the sequence does not start from image '0', and raising exceptions in case of mistakes.

```python
if type1 in extensions:
    return type1
```