Okay! I've fixed the bug!
turns out the problem was with the FreeImage library, which couldn't seem to load unicode filenames on Windows.. anywhere else in the code it works fine.. so now the gif files get loaded into memory before they get decoded by FreeImage.. problem solved :)