mutualise thumbnail generation code.
images are now linked by position and not by slice number