Attaching data to pictures

I am looking to attach some sort of numerical value to a picture so that when it’s clicked (the picture)- the numerical value and name l appears in an excel like table with 2 separate columns.

The idea would then be to have a total value at the bottom as more pictures with numerical values are clicked.

Does this even make sense? Please help if you can.