Bound states of solitons in inhomogeneous Josephson junctions