On Sd card?
It doesnt matter.
Uncheck the favorite pictures first.
Then copy everything to your pc/laptop or whatever.
Then delete al the images from your phone ( with help of your pc/laptop ).
Reboot the phone, check if its realy gone.
If yes, than place the images back.