pass images by reference