Item13008:Item13001: improve rendering of images

- only render the first frame of a gif animation generating thumbnails
- fix orientation of thumbnail as specified in the EXIF metadata
- fully specify REST security flags
- new parameter "output"
- adding support for debian packaging