Automatic regeneration of index.html in temp if needed

Automatically regenerate the index.html file in temp if doesn't exist (this ensures that it is always present, even if accidentally deleted while cleaning temp dir).