Formation of the HgI2 crystalline phase in the bulk and on the surface of nanocrystalline matrices