Not entirely sure how you generate your card numbers/pictures but one way would be to keep a table of used numbers/pictures and check against this table every time you generate new cards and skip the number/pic if it is on the list.