handle gifs and jpegs now as well