When I tried this a couple years ago, I had to save the decoded image to a tmp file then load that into a poster. But I don't recall any details, sorry.
also, it looks like you are writing to a file with no name?
mapFileName=""
uri="tmp:/images/"+mapFileName