better version test on jpeg read/write