update to handle many images at once