I'll keep that in mind from now on, thanks.
Yep, that was it. I forgot to set a value to aIndex.
sprite_queue is a global list. I run through it each drawing cycle. When parsing a new map or exiting the program, it clears the list. I have a separate queue for sf::Image which have corresponding ids.