Displaying images

Hi I have a question which I hope someone can help me. I am new to Corona SDK and I have minimum programming skill (thats why I am seeking help).
I need to create a function which display a random image when I click a button and when I click another button display a second designated image.
For example clicking “button 1” will display an image of a glove on the screen
clicking “button 2” will display an image of a hand.

hat–>head
shoes --> feet
dog collar --> dog
egg --> chicken
etc etc

This is for a simple program which I am trying to create for children to learn about relationship of things.
I am using math.random to generate a random picture “button 1” but I do not know how to keep the number constant which will allow me to call out the correct image with “button 2”
below are my codes. Will appreciate if anyone can shed some light. Or let me know if there is a better way of doing this.
I am using button UI

[code]
local buttonHandler = function( event )
if event.phase == “release” then
local img = {“1.jpg”,“2.jpg”,“3.jpg”} --there are more images
local r = math.random(1, #img);
if event.id == “button1” then
local image = display.newImage(img[r], 0, 0)
elseif event.id == “button2” then
local img ={“1a.jpg”, “2a.jpg”, “3a.jpg”} – image 1a.jpg is suppose to link to 1.jpg
local image =display.newImage(img[r], 0, 0)
end
end
end
[import]uid: 86993 topic_id: 15759 reply_id: 315759[/import]