The trick is to enclose the image and the license's link in a div tag and to use RDFa's about attribute to specify the resource. For example:
<div about="image.jpg">
<img src="image.jpg" alt="" />
<a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/">Creative Commons Attribution Share-Alike 3.0</a>
</div>