Fixed division by zero when corrupt jpeg selected (see #8)