fix thumbnail calculus in galery