When you delete photos, their pointers on that storage are removed, and the space is freed, but those files remain in storage until they are replaced with new data. With the right data recovery software, you can get those photographs back.