prevent js error if there is no image (closes #38)