extract the split result into a variable `path` (so that there's no repetition) and use the ternary operator:

```js
return (path ? path + '/' : '') + 'images';
```