convert non-jpeg images to jpeg when resizing