Unless you have pre-initialised your $head Array to a set size then you would use code like the following within your StoryInit special passage to add those head items to an empty Array.
<<set $head to []>>
<<set $head.push({
name: "none",
type: "Head",
unlocked: true,
equipped: true,
cost: 0
})>>
<<set $head.push({
name: "Glasses",
type: "Head",
unlocked: true,
equipped: false,
cost: 0
})>>
<<set $head.push({
name: "Pirate hat",
type: "Head",
unlocked: false,
equipped: false,
cost: 120
})>>
There are a couple of issues with your original example:
1. You are not suppressing or escaping the invalid line-breaks within the HTML table structure.
By default each line-break within the contents of a Passage is automatically converted to a HTML br element, and this element is invalid within a table structure if they appear anywhere other than inside the th or td elements.
2. You are using an undefined $wHead story variable as the index reference of your $head Array.
You would generally use the _i temporary variable you defined in your <<for>> macro for that.
3. You are trying to use Dot Notation to dynamically access the elements of your $head Array.
You can't do that, and will need to use square bracket notation instead as demostrated by the following example.
\<<for _i to 0; _i lt $head.length; _i++>>
\<<if $head[_i].equipped>>
\<<print $head[_i].name>>
\<<break>>
\<</if>>
\<</for>>
4. You aren't using a <<break>> macro to stop the <<for>> macro ones the equipped item is found.
The following is a slightly modified version of your original code, it resolves the above mentioned issues as well as uses the range version of the <<for>> macro to make things a little easier.
<table border = "2px">
\<tr>
\<th>Slot</th>
\<th>Wearing</th>
\<th>Image</th>
\<th>Change</th>
\</tr>
\<tr>
\<td>Head</td>
\<td>
\<<for _i, _item range $head>>
\<<if _item.equipped>>
\<<print _item.name>>
\<<break>>
\<</if>>
\<</for>>
\</td>
\<td>Image</td>
\<td>[[Change|Head]]</td>
\</tr>
\</table>
> I wonder if the locataion of the pictures should be stored inside the...
Personally I would store the images as external files in a location relative to the folder you save your published story HTML file in, you could then use a Relative URL to reference them.