Fix a bug in bimg