update this check to include all the conditions in which we want to generate a new image