Added more reporting to error message if MeasureImage fails.