ImageAnchors: fix the temp image ID passing, add some error handling, +cosmetic