Study of B -> X gamma decays and determination of vertical bar V-td/V-ts vertical bar