B ) can lua file will able to cache such url which have improper file name for image data
You can write an extension to cache images by the Content-Type field in the response headers received from the servers.
See eA_Dont_update_image_by_type.lua for example.