last fixes to new image tests

- correct checking of Python version number on py2.6
- force sorted order of plot legend on py3 (random dict order)