Added support for jpegs.