functionality to compress image larger then 1 mb