Extracting the imageId from the result.
Reading in the imageId dynamically.