small bugfix in image code