moved the validity test here instead inside the render function. the existing test did not prevent cases where
```js
icons = {3: undefined, 5: undefined}
```