added JPEG support