Magnetostriction effects of 3d4 and 3d6 ions in dilute magnetic oxide films