previews: refactoring

* Changes preview view function arguments, passess request arguments;
* Sends both filename and file from preview to extensions;
* Fixes PEP8;

Signed-off-by: Adrian-Tudor Panescu <adrian.tudor.panescu@cern.ch>