Small fixes on virtual products

- 2 new output var for image and document loop to get file name.
- fix a small js issue