Effects of initial axion production and photon–axion oscillation on type Ia supernova dimming