extracting image data, AJAXifying image loading