Easiest way would probably be to use a tiledbackground object and set it's width according to the amount of hearts..
so if the image of the heart is 100x100 pixels
add a tiled background object
load the image
set the tiled background to the height of 100 and the width of 100*(amount of hearts)