Scale the preview close button in proportion to the preview window.
Moved code from service.py into resources/lib