I am not sure I understand what you mean by that. The images is in the table named box.
You can always tag your image-objects with your own variable. Like this:
box[i][j].player = 1
As I see it the boxArray keeps track of your pieces and holds the current state of the game. The table named box is merely the visual representation of boxArray, but has very little to do with the game logic. But that is a matter of taste and design. There are other solutions, and this might not suit your needs or style of programming.