Periodic change of the magnetic and structural properties with thickness of Er thin films