fix bug that made old images appear

I don't really understand why the fix works, but it does