To install this package, run in Emacs:
M-x package-install RET dired-preview RET
This is a simple and robust package to automatically preview in a side window the file at point in Dired buffers. Preview windows are closed when they are no longer relevant, while preview buffers are killed if they have not been used for other purposes beside previewing. The package provides several customisation options to control its behaviour.