working out function for multiple images