JS helper improvements.

- For main page, use picture tagged with 'title_picture' if it's
  present, or first picture if it isn't.
- Use 'title' on both div and a elements (in that order).
- Ignore .htaccess.