Added image resize to screen support

  New config vars:
   - resizeToImg: if true, resizes div to content image. Only allowed if content == "image".
   - resizeToMaxScreen: resize to be this ratio to screen. 0 disables it. 0..1 allowed (1=100%).