Only preview gif, png and jpeg images. Fixes #181