Images from AFMs have "pages", ie multiple images contained in the data file. You can swap out the shown image by swapping out the page. However, if the page selected exceeds the number of images in the file, it will produce an error.
The user should not be able to select a page that doesn't exist, and if they do, it should revert to the last image ie the highest index.
So if there are 4 images, the pages for each image are 0, 1, 2, 3. If a user tries to select 4 before the image file is loaded, it should use 3 and change the control value to 3. Upon loading the image, it should not permit users to select a page higher than the max or min values.
Images from AFMs have "pages", ie multiple images contained in the data file. You can swap out the shown image by swapping out the page. However, if the page selected exceeds the number of images in the file, it will produce an error.
The user should not be able to select a page that doesn't exist, and if they do, it should revert to the last image ie the highest index.
So if there are 4 images, the pages for each image are 0, 1, 2, 3. If a user tries to select 4 before the image file is loaded, it should use 3 and change the control value to 3. Upon loading the image, it should not permit users to select a page higher than the max or min values.
Initially submitted by @jlevylab