you don't need to cast the returned object of the expression as you've previously checked it's either a DataResource of a ImageResource