Some mdfixes for image generation