@hund you have quotes on the rt.hand side of the icon & img assignments, but no quotes around $img. That's backwards. POSIX rules make quoting the RHS of assignments unnecessary but when you use (expand) the variable something like a space will cause multiple tokens. Luckily those vars don't have spaces in this case but you might want to get in the safer habit of quoting var expansions.
@hund @resist1984 https://www.shellcheck.net/ is very nice for catching that kind of brittleness in scripts.
@Steinar @resist1984 Thank you! I'll check it out.
@resist1984 I never use spaces, but it's probably a good idea to use quotes for the variables as well.