Electronic and atomic structures of gasochromic V2O5 films