fix grid drawing when a background image is set