Can I do this in adobe illustrator ?
yes you can do it easily
select all, resize your art to be as small as possible (22x200 or 300x300) and on the file menu select save for web, or something similar, I don't remember the sub-menu name but it has web on the title.
select the format you want (gif, jpeg, ...) and voila.