is a literal string. Every single character of this string will be assigned to .src of the image. This is clearly not what you wanted to do
Try this instead
"img/" + b + ".jpg"
Then you are reading a string from the image .src attribute. You want to add 1 to this string? Clearly not. You want to extract the current number (or store it somewhere) and increase it by 1. You'll have to rethink your code ....