If you're creating the hearts yourself, this is the best way:

First of all, always make sure your heart is on a different layer to the image (i.e. make a new layer for the heart). Make your heart shape with whatever tool, and fill it with your chosen colour. Then, with your heart selected (as in dotted-outline on picture selected), change layers back to the image, and invert your selection (ctrl+I). Then you can just delete, and press ctrl+shift+A to deselect everything.

To merge your layers down, select the top layer, right click it and choose merge down. If you have a heart with transparency but you need to select the outline, you can right-click the layer with the heart and choose alpha to selection.