Bug 995116 - [Tarako][MMS][Gallery] SMS/MMS OOM after attach a large pix...

...el picture from gallery r=azasypkin

This patch does the following changes:

* we use -moz-samplesize to decode the images to resize them
* we try to free data more aggressively