Cannot call method 'getImage' of undefined - fix