Add error condition when building image