Added support for JPEG images.