Use absolute path when storing images

closes #1983