variable parsing in watermark path

Also, fixed some segfaults when watermark is not found or not an PNG
image.
Merge pull request #3 from seletskiy/master

variable parsing in watermark path