Refactor, fix hide/show of prev/next cards when there is none