[test_freeimage] Allow ValueError to be raised

With the truncated image, sometimes ValueError is raised. This allows
either RuntimeError (i.e. libfreeimage error) or ValueError to be
raised.