small refactoring and adjustments
jsling: removed redudant initialPreviewWidth variable
jsling: removed unused variables