Hi, I try this I can make it work on an attachment file but not on a picture, I don't know why. You can do something a little different with a Rich text field. you save your file somewhere and you modify the inner xml of your RT field like that:
<IMG xmlns=\"http://www.w3.org/1999/xhtml\" SRC=\"" + YOURPATH+ "\" />";
It will show you the image