Spacing between adjacent planes of a given set in a simple cubic crystal

Today I learned about Miller indices in a cubic crystal, and I learned that adjacent planes $$(hkl)$$ in a simple cubic crystal are spaced a distance $$d_{hkl}$$ from each other, with $$d_{hkl}$$ given by:

$$d_{hkl} = \frac{a}{\sqrt{h^2 + k^2 + l^2}}$$

For example, take the origin any of the below vertices of the cube with z axis directed upwards, the $$(0 0 2)$$ plane cuts horizontally the middle of the cube, and for this set of planes, $$d_{hkl} = \frac{a}{2}$$.

May be a silly question, but if we followed the rule of spacing, we would get that the next $$(0 0 2)$$ plane is the very upper horizontal plane in the cube, which - i guess - is not true since the latter plane has $$(0 0 1)$$ and not in any case $$(0 0 2)$$ miller indices. However, if we considered that $$(0 0 2)$$ planes are only those passing horizontally through the middle of unit cells, then the distance between them will equal $$a$$ and not $$\frac{a}{2}$$ (using imagination and not rules).

I must be missing something very trivial here, but it is only today that i started learning these stuff and i am really confused. Thanks for help.