Fixed bug with Sprite generation

If the sprite name is the same name as one of the contained images the
sprite generation would fail. This fixes this.