Your pallet shelf idea would work perfectly for that space. What do you store in the closet? Can shoe shelves be put in there? I have something like this in one of my closets and it is adjusted for the space. I think I paid less than $20 at a big box store.
https://www.alibaba.com/product-deta...fcadlfW8Bi&s=p
Your pallet idea is better, but I know how likely a project like that is to get done in my house.