Added gif and jpeg support.