Allow send image other than jpeg

If try to send image other than jpeg, it will return imagecreatefromjpeg(): gd-jpeg: JPEG library reports unrecoverable error. Checking file extension to split to seperate formats.
Merge pull request #158 from akifrabbani/patch-1

Allow sending gif, png images too