Add timestamp to filename to prevent overwriting existing files.

Also fix common block so mask path works.