Fix transparency issue in png and gifs

- http://croogo.lighthouseapp.com/projects/32818/tickets/396-resized-png-attachments-are-plain-black
- http://www.akemapa.com/2008/07/10/php-gd-resize-transparent-image-png-gif/
- https://groups.google.com/forum/?fromgroups#!topic/croogo/F00CZBvmf7g

Closes #396, GH-174

Signed-off-by: Rachman Chavik <rchavik@xintesa.com>