added Cron jobs and fixed javascript

Cron support is added for updating images which means the user will no
long have to wait for the server to fetch and parse the json image
data. The server will automatically update the images every 10 minutes
through a Cron job

Fixed many javascript and jquery bugs.