help with using clCreateImage2D

I am pretty much new to OpenCL.
I want to read a jpeg image file into the kernel, do some processing, get the results back to the host and output the image file into some other location. I am facing some difficulties doing this.

When using the clCreateImage2D, I need to specify the size of the image manually. Is there a way that I can get the size of the image from some routines and pass them to this function.?

Also I need to understand what the “host ptr” arguement(last but second arguement) exactly means in clCreateImage2D routine. Is it like we can specify the location of the image directly ?