First you add your picture to the sidebar using the StoryCaption special passage, meaning a passage titled "StoryCaption":
<span id="health"><img src="yourimagehere" width="100%"></span>
Now, whenever the players life changes call this code:
<<if $hp gte 75>>
<<replace "#health">><img src="yourimagehere" width="100%"><</replace>>
<<elseif $hp gte 50>>
<<replace "#health">><img src="yourotherimage" width="100%"><</replace>>
<<elseif $hp gte 25>>
<<replace "#health">><img src="yourthirdimage" width="100%"><</replace>>
<<else>>
<<replace "#health">><img src="yourlastimage" width="100%"><</replace>>
<</if>>
To safe time and keep things more readable create a widget to do this for you. Make a passage, give it the tag "widget", then say something like:
<<widget hp>><<nobr>>
<<set $hp += $args[0]>>
<<if $hp gte 75>>
<<replace "#health">><img src="yourimagehere" width="100%"><</replace>>
<<elseif $hp gte 50>>
<<replace "#health">><img src="yourotherimage" width="100%"><</replace>>
<<elseif $hp gte 25>>
<<replace "#health">><img src="yourthirdimage" width="100%"><</replace>>
<<else>>
<<replace "#health">><img src="yourlastimage" width="100%"><</replace>>
<</if>>
<</nobr>><</widget>>
If you now want to lower hp by for example 10, you can just say:
<<hp -10>>
To add hp similarly:
<<hp 10>> or <<hp +10>>