Generate base image if it doesn't exist.