merge skinratio() and some other fixes
limit metadata thumbs to be at most 512KB
limit the number and size of the automatically created thumbnails