I had to create a new schedule task instead of importing an existing one. I followed the above link and it worked. Also make sure Add-snapin sharepoint is in the sp1 file.
Update-SPProfilePhotoStore -CreateThumbnailsForImportedPhotos 1 -MySiteHostLocation http://mysitehostlocation/MySite/
Save the file as a .ps1 file on your SharePoint 2010 server – C:\Scripts\UpdateSPPhotos.ps1
Create a daily scheduled task on the SharePoint 2010 server that runs at the SharePoint Farm Administrator account.
Configure the action as follows
Arguments: -NonInteractive -NoProfile -File "C:\Scripts\UpdateSPPhotos.ps1"