Expanding Convert function to allow conversion between PDF and PNG