Why is htc one m8 photos/videos getting corrupted?

My phone was running low on phone storage and only had 500mb left. I deleted stuff and now it has about 1GB free. All my photos and videos are saved on sd card by default anyways but when I take new photos/videos I can see them in gallery fine but when I check my phone after few hours they just disappear and I can only see grey icon that says video not supported. It seems like they are all getting corrupted. I have no idea what is causing this and why is it happening...

Have you tried a different SD Card? I've had too many issues with failing SD cards to keep saving my camera files on them. I just use them for large files and stuff I've already backed up somewhere else