I've tested to keep this

```css
img.style.visibility = 'hidden';
```` 
and works fine both cases