I had the same issues, after reading through the comments and solutions here (and tweaking it slightly) this worked for me:
diceImageView1.image = #imageLiteral(
the open bracket above was essential to get it to work.
This is interesting, I wonder if this is a bug?