To prevent image cache by adding version: the version as a param or a part of filename?

Generally the image would full cached by using http header: expire or cache-control,
In order to images on client keep up with server's,
Generally there are two ways:
1.use the md5 as the a part of the name; e.g.: my.md5.css
2.change the param: e.g.: my.css?v=md5

which one i should to use?how to choose?