  Lead phthalocyanine (PbPc), a non-planar molecule, is studied on Pb(100)
using scanning tunneling spectroscopy. A rigid shift of the molecular orbitals
is found between molecules with the central Pb ion pointing to
(PbPc$\downarrow$) or away (PbPc$\uparrow$) from the substrate and understood
from the interaction between the molecules and their image charges. Inside the
superconducting energy gap, Yu-Shiba-Rusinov (YSR) resonances are observed for
PbPc$\uparrow$ molecules in islands indicating the presence of a magnetic
moment. Such bound states are neither present on PbPc$\downarrow$ molecules nor
isolated PbPc$\uparrow$ or molecules that lost the Pb ion during deposition
(H$_0$Pc). The YSR energies vary depending on the orientation and type of the
molecular neighbors. We analyze the role of the out-of-plane dipole moment of
PbPc.
