Setting image in popup/ creating main dir if not available.