How to restore my iphone but only in the pictures area?

When I delete my pictures straight off of my phone it still says i don't have storage. I know I can restore the whole thing and itd be good but id rather not lose all my contacts.

How can i just restore the pictures?

Did you delete the pictures from the Recently Deleted album as well? If not that's why it states that.

Do you have backup files? You can recover them from iCloud/iTunes backup by iMyfone iphone data recovery easily.