Fix bad_format_imginfo

The previous behavior could segfault with an imginfo string such as "%s%s %lux$lu", whereas this correctly rejects that format string.