Change mask history file save to memory buffer
Rename mask fileIndex property to hIndex