Created duplicate of selected image and added compression to that.
Added sample size to compress.
Formatted the code.
Merge pull request #22 from fashiontec/issue_19

Issue 19