Clearing up the cache won't have any effect in the loss of data (photos or anything) instead, it will provide you more room by clearing up some storage. I myself cleared cache in the Gallery all the time but no photos ever lost. Cache is just a temporary data which can not result in lost of important data.
Still, if you are worried about clearing cache then I would suggest you, to clear cache selectively using the app like App Cache Cleaner.