This line of code is supposed to reuse the thumbnail if it existed. Under which conditions is the other orphan created? My guess is that it may not be in this section of the code.