Rearranged js code a bit.
Put code from bottom of card into card.js and wrap in $(document).ready().
Changed brace style in that file.
Renamed img to image. Seems to fix problem with rescaling.