Added automatic conversion into .png instead of determining the filetype.