Fixed a wrong variable affectation
Commented the format-finding stuff
Declaring previewAnchor before using it, that's better
Now checking if wallpapers are in JPG or PNG, then fixing the URL accordingly