change ecalloc() arguments, add animation gif support