allowed 0 height or 0 width for thumbnail

1. I have slightly changed the condition to allow 0 height or 0 width but not both.
2. This will allow to crop based on width only if 0 height is provided.
3.  This will allow to crop based on height only if 0 width is provided.