fix bitmap export with resolution without margin
cleanup