add the build image function