A nonconvex penalization algorithm with automatic choice of the regularization parameter in sparse imaging