handle JPG as well as jpg