fixed bug item #7575: skip thumbnail creation/try to adapt memory_limit if image is too big for memory

fixed an issue with the template path