OK, I kinda understand why you want to do it this way - if you asked before you started coding, then I'd have suggested a array of UDT's containing the sprite id, removing this as a problem completely.
However, here's how I'd fix your existing code:
When you want to 'kill' an existing sprite, you currently delete its array element (shifting all further elements down 1 automatically), then you 'rename' the sprites above to close the gap (51 becomes 50, 52 becomes 51 etc).
Instead of deleting the array element, copy the data from the last element into it, then delete the last element in the array. Then you can do the same with the sprite - clone the last sprite over your 'killed' sprite, then delete the last sprite.
Now that may not work depending on what else you are doing in the code, and whether a sprite id has any relevance beyond being just an id. Only you can know that.