Added SVG support.

- Added SVG support.
- Improved the delete file subroutine. ( Now check if the image is still
used by another post before deleting the file )
- Removed redundant code.