Camera/Image Issues

Hello, Ive been trying to create an app that when the app opens it then opens the camera feed and takes a photo every second, I couldnt get that to work so Im currently trying to take a screenshot of the camera feed.

Any and All help is much appreciated, Thanks in advanceĀ 

local centerX = display.contentCenterX local centerY = display.contentCenterY local width = display.contentWidth local height = display.contentHeight local background = display.newRect(centerX, centerY, width, height) background:setFillColor(0.5, 0, 0) local function screenShot(event) image = display.captureScreen() end local cameraListener = function(event) if media.hasSource(media.Camera)then media.capturePhoto({cameraListener = screenShot}) end return true end timer.performWithDelay(1000, screenShot, 5) --(Final Tag after listener is how many repeats you want) -- 0 means it repeats forever background:addEventListener("tap", cameraListener)