Basis functions in DCT
Because the upper left square would correspond to values of $p=0$ and $q=0$, and $cos(\alpha) = 1 $ if $\alpha=0$, so you get a constant term, that is why it is all gray.
Basically as you increment $p$ and $q$ you get basis images that oscillate more either in vertical or horizontal directions.