Hi Zakaria
I would have expected your approach to work. This following blog also covers a similar approach.
Dynamic File Name in Multimapping - Standard Solution
Can you share screenshot of the Message Attributes section of your message(like below)? Just to check that the attributes are populated correctly with different values during runtime.
Image may be NSFW.
Clik here to view.
Regards
Eng Swee