minor fix to check if project has image before setting the dirty flag to false.