added setPropertiesFromResource
added possibility to create image from gd resource
removed repeated code
added isBinary and isImageResource
cleanup tests
universal input possibility for constructor