Rectangular and square skyrmion crystals on a centrosymmetric square lattice with easy-axis anisotropy