Was this problem a regression due to bug 989290? Looking at the changes, I'm not sure how those changes caused this problem. I could be missing something, but It doesn't seem like the those changes affect image filenames.