Doesn't sudo only affect the first command? I'd run it in a sub-shell by using quotes, e.g.,
sudo "gunzip -c generic-pc-1.235.img | dd of=/dev/sdb bs=16k"
Or perhaps better a double sudo
sudo gunzip -c generic-pc-1.235.img | sudo dd of=/dev/sdb bs=16k
Of course one could always just run as root but it is a practice to be discouraged.