Fix issues #8 and #12.

Fixes #8 (the variable to check the breakpoints against would not be reset) and attempts to prevent #12 from breaking the page completely (don't set a max-height if the image is not loaded properly).