QCD corrections to heavy flavour photoproduction and electroproduction