Bash script to use Bing’s background as wallpaper

I’ve been using a static wallpaper on my Linux machine, but using Bing’s desktop application on my Windows machine to change the wallpaper. The application sets the wallpaper to the current Bing background and changes it on a daily basis. Since there is no equivalent application for Linux, I wrote a small shell script to download and set the picture as a wallpaper. The script is over at GitHub, but also pasted below (check GitHub first). It requires wget and feh.

When I run it on my system (fedora 21) I get this errors:
bing.sh: line 90: let: number = 21958 % 0: division by 0 (error token is “0”)
bing.sh: line 92: &n=1: syntax error: operand expected (error token is “&n=1”)