Added support for different types of images (extensions).