Maybe there could be a separate area of the database for Companion Plants. Each photo uploaded would have a list of all the plants in the picture, and those names would link to each plant's entry in the database, and vice versa. Could that work?
Confidence is that feeling you have right before you do something really stupid.