added gif, jpeg support