That Error clearly telling where you did mistake. you gave wrong format. there is no syntax with "%s.jpg".
what you want to do?
The lesson here is that a %s does not know where to stop. It will just take the rest of the string. Using the %[^.] will grab a string up to a found period (not including the period).