Added code to generate the full path to the image preview

The image entity can't generate the full path as it doesn't know the location of the web directory.