A couple more sql fixes and basic js

For now we're assuming that all excerpts are displayable (image or video)