Verify if attachmentsStore initialized when layer has attachments

Closes #214