Easiest is to reject duplicates when you add to queue. If that (for some reason) is not possible I would do something like this:
Get pending Item ->
Loop Pending Item -> Get Item Data -> Save Item Data to Collection -> End Loop ->
-> Remove duplicates (e.g: sort Collection -> Loop Collection -> Same as last? If yes: Delete Item, If no: End Loop.