shader: Update last image index also for created arrays
Otherwise we will get a binding overlap between shader stages if indirect image access is done in the shader and we re-create the array of images in the host.
Remove an unnecessary type cast as well.