Fixed null char in gif/jpeg causing problems, everything works