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.

(at top)
```python
from os.path import splitext
```
then
```python
image_type = splitext(fname)[-1][1:]
```