The imagery and symbolism used in both of these stories are used to convey the central character in each story, and to develop the themes that the stories raise. For example, in "A&P," the way Sammy refers to the customers who come to the supermarket where he works expresses his sense of humour but also his distaste for those who go along in life and just go with the flow. For example, note the way that he talks about the "cash-register-watchers" who deliberately want to trip up the cashier attendants. Consider the way he refers to the customers as "sheep." These examples of imagery are very significant, particularly the last metaphor, as it demonstrates the theme of whether it is right to go along with the crowd unquestioningly, or to stand up and challenge the status quo when it is appropriate. The use of the metaphor "sheep" by Sammy strongly foreshadows the stand that he takes at the end of the story; after all, he can hardly mock customers for being sheep-like if he then is a sheep himself when challenged by his boss.
In the same way, the imagery in Araby is used to develop the theme of appearance vs. reality, and how the narrator is unable to differentiate between the two. Note for example how Mangan's sister is described in the following quote:
She was waiting for us, her figure defined by the light from the half-opened door.
Firstly, Mangan's sister is always associated with light, which makes her seem angelic. Secondly, the way she is described would make her appearance very difficult to work out. The narrator seems to base his teenage hopes and love on an insubstantial figure, which of course pre-empts his epiphany at the end of the story where he realises the reality of his romantic hopes and dreams. The imagery in both stories then help develop the respective themes and characters.