The code you have is expecting a path to the image in your "Image" field, not an image itself.
Where you say one of the fields is a type of raster.. Are you saying that you have the raster stored in a BLOB field in the table itself?
If so, the only BLOBs supported by the REST are the ESRI attachments.
If this is the case, you could use your data as the lookup table and use the attachemnts tool to extract the images out, then add them in as attachments.
Attachments are fullly supported within the flex popups.
R_