I also output to both pdf and html formats - but using different hacks for each (I know!)
For pdf, I have an image in a pdf, with this code in before_body.yml
\includepdf[pages={1}, scale=1]{Cover_image_1.pdf}
\newpage
For html, here's some excerpts from my index.rmd
---
title: |
{height=350px}
site: bookdown::bookdown_site
---
```
# Introduction {-}
<img src="my_image.png" style="position:absolute;top:50px;height:350px;align:center;" />