Cleaned up the code a bit (not much though as I didn't really want to break anything and I don't have pinterest API keys anymore.