How to user images and its source attribute

My plotly scatter chart works in my Shiny for R application. Now I am trying to add a background image to the plot using the ‘layout’ and its source attribute. Here is the relevant piece of code:

    pplot <- plot_ly(type='scatter',mode='lines',x=df[,2],y=df[,1],line=list(color='black'))%>%

I am getting the following error:

EOF whilst reading MBCS char at line 1

With a stacktrace that shows that the error is in the line above. If I remove “images=list(…” then the plot renders fine but obviously without the background image in the file