preview an image in frontend
version 2