Add safety check to ensure external storage is available before saving attachments