Only try to open jpg or png.