Merge pull request #28 from mrwonderman/issue_27_possible_NPE

moved image def to constructor