Bug 1008071 - [Tarako][Messages]Sometimes attach Gallery image will cause Messages app be killed. r=julienw

- Uplift Bug 995116 with some conflicts fixing.
- Block file attaching while resizing