Fixed .gif crash

Fixed crash that occurred when opening a file with a .gif extension that
is not a gif.