On the cohomology of 3D digital images