D* and J/psi inelastic photoproduction at HERA