That perfectly worked. Very clear explanation. Thanks a lot.
(Opinion: In this case I believe it is better Adobe changes PlacedItem.embed() to return the new RasterItem object to make the life easier for the developers. Should the document contain previously embedded artwork then I guess rasterItems[0] will not be pointing to the rasterItem object the code just created.)