Fix issue where 'image' variable is not defined

Fixes issue 262