def get_bond(structure, labels, a1, a2, img1, img2):
    """
    Calculate bond vector between atom1 (at image1) and atom2 (at image2).

    Args
    ----
    structure: pymatgen.core.Structure
        Pymatgen Structure object.

    labels: list
        Atom labels from CIF in correct order such that the coordinates from
        structure can be taken by index.

    a1: str
        Label of atom 1 in bond.

    a2: str
        Label of atom 2 in bond.

    img1: np.ndarray
        (1x3) array of image flags for atom 1.

    img2: np.ndarray
        (1x3) array of image flags for atom 2.
    """

    # get fractional coordiantes of correct images of atoms.
    a1_pos = structure[labels.index(a1)].frac_coords + img1
    a2_pos = structure[labels.index(a2)].frac_coords + img2

    # get cartesian coordinates.
    a1_cart = structure.lattice.get_cartesian_coords(a1_pos)
    a2_cart = structure.lattice.get_cartesian_coords(a2_pos)

    return a2_cart - a1_cart