I am glad that my decision helped you.
You can play around with this.
let bg = this.add.image(window.innerWidth / 2, window.innerHeight / 2, 'bg')
bg.orgWidth = bg.displayWidth
bg.orgHeight = bg.displayHeight
bg.update = function () {
if (app.width * this.orgHeight/this.orgWidth < app.height){
this.displayWidth = app.height * this.orgWidth/this.orgHeight
this.displayHeight = app.height
}else{
this.displayWidth = app.width
this.displayHeight = app.width * this.orgHeight/this.orgWidth
}
}

In the horizontal view, it will always adjust proportionally in width, if the portrait view is proportional in height.