Change the code so that it does not use any of the shared memory that relates to the number of images.